<?php

class Application_Form_Defrequete extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
    	
    	$this->setName("FormulaireDefrequete");
    	
    	
    	$label = new Zend_Form_Element_Text('LABELRequest');
    	$label ->setLabel('Label Requete');
    	
    	$withchart = new Zend_Form_Element_MultiCheckbox('WITHCHART', array(
    			'multiOptions' => array("OUI"=>"OUI","NON"=>"NON")
    	));
    	$withchart->setLabel('Avec chart');
    	
    	$service = new Zend_Form_Element_Text('servicedemande');
    	$service ->setLabel('Service demander');
    	$service->setValue("autre");
    	
    	
    	$requete = new Zend_Form_Element_Text('idPILOT_REQUEST');
    	$requete ->setLabel('Requete         ')
    	->setRequired(true)
    	->addFilter('StripTags')
    	->addFilter('StringTrim')
    	->addValidator('NotEmpty')
    	->setAttrib('class','validate[required] text-input');
    	 
    	
    	
    	$mapper= new Application_Model_Mapper_PilotModelanalyse();
    	$select=$mapper->fetchAllToArray();
    	
    	
    	$tmp=array();
    	$tmp['']="selectionner modele";
    	foreach ($select as $key => $value ){
    		$tmp[ $value['idPILOT_MODELANALYSE'] ] = $value['idPILOT_MODELANALYSE'];
    	}
    	$listModelActivite = array("multiOptions" => $tmp);
    	
    	$Model= new Zend_Form_Element_Select('idPILOT_MODELANALYSE',  $listModelActivite);
    	$Model->setLabel('Modele')	;
    	
    	
    	 
    	$description = $this->CreateElement('textarea', 'REQUESTTEXT');
    	$description->setAttrib('rows', '7');
    	$description->setAttrib('cols', '35');
    	$description->setLabel('SQL Text');
    	
    	$valider = new Zend_Form_Element_Submit("submit");
    	$valider->setLabel("Ajouter");
    	
    	$this->addElements(array($requete,$label,$service,$Model,$withchart,$description,$valider));
    	$this->setDecorators( array( array('ViewScript', array('viewScript' => 'protypeform.phtml'))));
    	
    }


}

